<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Jazz</title>
    <link type="text/css" href="css/common.css" rel="stylesheet">
    <link type="text/css" href="css/chosen.css" rel="stylesheet">
    <link type="text/css" href="css/css.css" rel="stylesheet">

    <script src="js/jquery-1.8.2.min.js"></script>
    <script src="js/util.js"></script>
    <script src="js/service.js"></script>
    <script src="js/config/language.js"></script>
    <script src="js/config/menu.js"></script>
    <script src="js/jquery.simplemodal-1.4.5.js"></script>
    <!-- <script src="js/chosen.jquery.en.js"></script> -->
    <script src="js/jquery.base64.js"></script>
    <script src="/js/lib/knockout/knockout-3.4.2.js"></script>
    <script src="/js/lib/knockout/knockout.simpleGrid.js"></script>
    <script src="/js/config/service.js"></script>
    <script src="/js/lib/underscore/underscore-min.js"></script>
    <script src="/js/lib/jquery/translate.js"></script>
    <script src="/js/lib/base64.js"></script>
    <script src="js/config/statusBar.js"></script>

    <script type="text/javascript">
        window.isCanPollingSMS = true //当执行短信的发送、保存、删除时 停止查询收件箱
            //解决IE浏览器不支持Array.find方法 IE8及一下不支持filter/map方法
        if (!Array.prototype.map) {
            Array.prototype.map = function(callback) {
                var result = []
                for (i = 0; i < this.length; i++) {
                    result.push(callback(this[i]))
                }
                return result
            };
        }
        if (!Array.prototype.filter) {
            Array.prototype.filter = function(callback) {
                var result = []
                for (i = 0; i < this.length; i++) {
                    if (callback(this[i])) result.push(this[i])
                }
                return result
            };
        }
        if (!Array.prototype.find) {
            Array.prototype.find = function(callback) {
                return callback && (this.filter(callback) || [])[0];
            };
        }

        var _baseGlobalParam = {
            BaseInfo: {},
            ShowNoInternet: true,
            UnReadMsgInterval: null,
            ShowedSMSIds: []
        };
        var ts = {
            monthly_tx_bytes: 0, //总的传输字节（单位：B）
            monthly_rx_bytes: 0, //总的接收字节（单位：B） 
            monthly_time: 0, //总的联网时间（单位：s）
            realtime_tx_bytes: 0, //当前传输字节（单位：B）
            realtime_rx_bytes: 0, //当前接收字节（单位：B） 
            realtime_time: 0, //当前联网时间（单位：s） 
            realtime_tx_thrpt: 0, //上行速率（单位：Byte/s）
            realtime_rx_thrpt: 0, //下行速率（单位：Byte/s） 
            max_tx_thrpt: 0, // 上行最大速度（单位：Byte/s）
            max_rx_thrpt: 0, // 下行最大速度（单位：Byte/s）
        }

        $(function() {
            // 获取当前设备设置的语言
            $.get('goform/goform_get_cmd_process?isTest=false&cmd=Language&multi_data=1&_=' + new Date().getTime(), {}, function(data) {
                var result = $.parseJSON(data);
                var lang = window.CurrentLang;
                if (result && result.Language && window.SupportLang[result.Language]) {
                    lang = result.Language;
                    $('#selLanguage').val(lang);
                }
                window.LTELanguageChange(lang);
            });

            if ('onhashchange' in window && (typeof document.documentMode === 'undefined' || document.documentMode == 8)) {
                window.onhashchange = _baseHashCheck;
                _baseHashCheck();
            } else {
                setInterval(_baseHashCheck, 1000)
            }

            // 定时获取基础数据
            setInterval(function() {
                refreshDeviceStatus();
                _baseGetBaseInfo();

                // 设备状态数据
                var _tempStatusInfo = window._service.getStatusInfo();
                // 电量百分比
                // if (_tempStatusInfo.battery_level_http) {
                //     $("#batteryLevel").html(_tempStatusInfo.battery_level_http + "%");
                // }
                // sim卡状态图片
                $("#statusItemSimStatusImg").attr("src", window._status.getSimStatusImg(_tempStatusInfo.simStatus));
                // 网络提供商
                $(".spanNetworkOperator").html(_tempStatusInfo.networkOperator).show();
                // 链接状态图标
                window._service.getHotspotList({}, function(hotspotList) {
                    $("#iConnectionStatusImg").attr("class", window._status.getConnectionStatusImg(_tempStatusInfo, hotspotList.hotspotList));
                });
                // wifi状态图标
                // $("#wifi_status_img").attr("src", window._status.getWifiStatusImg(_tempStatusInfo.wifiStatus));
                // 短信发送报告
                if (_tempStatusInfo.isLoggedIn && !window._service.simStatusInvalid(_tempStatusInfo.simStatus)) {
                    if (_tempStatusInfo.smsReportReceived) {
                        window._service.resetSmsReportReceivedVar();
                        window._service.responseSmsReport();
                    }
                }
            }, 1000);

            // 连接网络、断开网络
            $('#spanNetworkStatusImg').bind('click', function() {
                if (_baseGlobalParam.BaseInfo == null) {
                    return;
                }

                var showStatus = "connecting";
                if ($('#spanNetworkStatusImg').attr('class').indexOf('bg-wrap-on') >= 0) {
                    showStatus = "disconnecting";
                }

                showLoading(showStatus);
                if (showStatus == 'connecting') {
                    _baseChangeNetwork();
                    return;
                }

                // 断开链接要验证是否链接wifi
                window._service.getHotspotList({}, function(data) {
                    var extSSID = false;
                    for (var i = 0, len = data.hotspotList.length; i < len; i++) {
                        if (data.hotspotList[i].connectStatus == "1") {
                            extSSID = true;
                            break;
                        }
                    }
                    if (extSSID) {
                        var para = {};
                        para.ap_station_enable = '0';
                        window._service.setAPStationBasic(para, function(data) {
                            window.location.reload();
                        });
                        window._service.refreshAPStationStatus();
                    } else {
                        _baseChangeNetwork();
                    }
                });
            });

            window._status.init();
            $('body').translate();
            setTimeout(function() {
                $('body').show();
            }, 1000);

            $('#first-menu').bind('click', function() {
                if (!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))) {
                    return
                }
                if ($(this).hasClass('unfold')) {
                    $(this).removeClass('unfold')
                } else {
                    $(this).addClass('unfold')
                }
            })

            if ((/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))) {
                $("#main-top").addClass('mobile')
                $("#main-top").removeClass('pc')
            } else {
                $("#main-top").addClass('pc')
                $("#main-top").removeClass('mobile')
            }
        })

        // 是否需要登录
        function _needLogin(callback, needShowModal) {
            $.getJSON("/goform/goform_get_cmd_process", {
                isTest: 'false',
                cmd: encodeURI("loginfo"),
                multi_data: 1,
                sms_received_flag_flag: 0,
                sts_received_flag_flag: 0,
                "_": new Date().getTime()
            }, function(data) {
                if (data.loginfo != 'ok') {
                    // 需要登录
                    if (location.hash != '#home' || needShowModal) {
                        $("#confirmForCus").show();
                        $("#txtPwdError").hide();
                        $('#popupSettingWindow').modal({
                            position: '30%',
                            overlayId: 'confirm-overlay',
                            containerId: 'popupSettingWindow',
                            minHeight: 270,
                            maxHeight: 270,
                            minWidth: 320,
                            maxWidth: 320,
                            width: 320,
                            persist: true,
                            focus: false,
                            escClose: true,
                        });
                    }
                } else {
                    _indexInitUSSD();
                }

                if (callback) {
                    callback(data.loginfo != 'ok');
                }
            }).error(function(error) {});
        }

        function _login() {
            var username = $('#txtUserName').val();
            if (!username.length) {
                showAlert($.i18n.prop('input_username'), function() {
                    $('#txtUserName').focus()
                });
                return;
            }

            var password = $('#txtPwd').val();
            if (!password.length) {
                $("#txtPwdError").show();
                return;
            }

            $('#div_loading').show()
            $('#frmLogin').hide();
            $.ajax({
                url: '/goform/goform_set_cmd_process',
                type: 'Post',
                timeout: 8000,
                cache: false,
                data: {
                    goformId: 'LOGIN',
                    password: $.base64.btoa($('#txtPwd').val()),
                    username: $.base64.btoa($('#txtUserName').val())
                },
                success: function(data, status) {
                    var result = 5;
                    var val = $.parseJSON(data);
                    if (val && val.result) {
                        result = val.result;
                    }
                    parseLoginResult(result);
                }
            });
        }

        function parseLoginResult(result) {
            if (result == 0) {
                $.modal.close();
                _indexInitUSSD();
                return true;
            }

            // 登录失败，显示可尝试次数或锁账号提示
            var loginData = window._service.getLoginData();
            $.modal.close();
            if (loginData.psw_fail_num_str > 0) {
                showAlert('password_error_left', null, loginData.psw_fail_num_str);
                return;
            }

            if (loginData.login_lock_time == 300) {
                showAlert('password_error_five_times');
                return;
            }

            showAlert('password_error_account_lock_time');
        }

        function _indexInitUSSD() {
            if (window._isInitedUSSD || window.location.hash != '#ussd') {
                return;
            }

            window._service.USSDReplyCancel(function(result) {});
            window._isInitedUSSD = true;
        }

        function _baseChangeNetwork() {
            $.getJSON('/goform/goform_set_cmd_process', {
                goformId: (_baseGlobalParam.BaseInfo.ppp_status == 'ppp_connected' ? 'DISCONNECT_NETWORK' : 'CONNECT_NETWORK')
            }, function(data) {
                if (!data || !data.result || data.result.toLowerCase() != 'success') {
                    hideLoading();
                    showAlert('failure');
                    return;
                }

                // 当该接口返回 success 后，需要循环去查询网络状态（具体接口见“操作：读取联网状态”），直到网络状态值为 ppp_disconnected/ ppp_connected 为止。
                var _timerLoadNetwork = setInterval(function() {
                    if (_baseGlobalParam.BaseInfo.ppp_status == 'ppp_disconnected' || _baseGlobalParam.BaseInfo.ppp_status == 'ppp_connected') {
                        hideLoading();
                        clearInterval(_timerLoadNetwork);
                    }
                }, 1000);
            });
        }

        var currentUrl = ''

        function _baseHashCheck() {
            if (window.location.hash === currentUrl && currentUrl != "") {
                return
            }

            currentUrl = window.location.hash;
            // 如果ussd_action=1要下发ussd_cancel指令
            if (window.JAZZ_USSD_ACTION == 1 && currentUrl == '#ussd') {
                window.JAZZ_USSD_ACTION = 0;
                window._service.USSDReplyCancel(function(result) {});
            }

            var match = window.findMenu()
            if (match.length == 0) {
                if (!window.location.hash.indexOf('http') == 0) {
                    window.location.hash = '#home'
                }
            } else {
                _needLogin(function(need) {
                    if (!need) {
                        _baseGotoContent(match[0])
                    } else {
                        window.location.hash = '#home'
                        match = window.findMenu()
                        _baseGotoContent(match[0])
                    }
                });
            }
        }

        function _baseGotoContent(menu) {
            var toUrl = menu.path + '.html';
            if (menu.checkSIMStatus) {
                var info = window._service.getStatusInfo();
                if (info.simStatus == undefined) {
                    showLoading('waiting');

                    function checkSIM() {
                        var data = window._service.getStatusInfo();
                        if (data.simStatus == undefined || $.inArray(data.simStatus, window._service.config.TEMPORARY_MODEM_MAIN_STATE) != -1) {
                            addTimeout(checkSIM, 500);
                        } else {
                            hideLoading();
                            gotoPage(data.simStatus)
                        }
                    }
                    checkSIM();
                } else {
                    gotoPage(info.simStatus)
                }

                function gotoPage(simStatus) {
                    if (simStatus == "modem_sim_undetected" || simStatus == "modem_sim_destroy") {
                        toUrl = "view/nosimcard" + '.html';
                    } else if (simStatus == "modem_waitpin" || simStatus == "modem_waitpuk") {
                        toUrl = "view/nosimcard" + '.html';
                    } else if (simStatus == "modem_imsi_waitnck") {
                        toUrl = "view/network_lock.html";
                    }

                    $('#ifrContainer').load(toUrl, function() {
                        $('#ifrContainer').translate();
                    });
                }
                return
            }

            $('#ifrContainer').load(toUrl, function() {
                $('#ifrContainer').translate();
            });
        }

        function _baseGetBaseInfo() {
            if (window.isCanPollingSMS == false) return

            $.getJSON("/goform/goform_get_cmd_process", {
                isTest: 'false',
                cmd: encodeURI("loginfo,sta_count,sms_unread_num,realtime_tx_thrpt,realtime_rx_thrpt,monthly_tx_bytes,monthly_rx_bytes,signalbar,network_type,ppp_status,modem_main_state,monthly_time,realtime_tx_bytes,realtime_rx_bytes,realtime_time,max_tx_thrpt,max_rx_thrpt,EX_SSID1,sta_ip_status,sub_network_type"), //,max_tx_thrpt,max_rx_thrpt
                multi_data: 1,
                sms_received_flag_flag: 0,
                sts_received_flag_flag: 0,
                "_": new Date().getTime()
            }, function(data) {
                if (data.loginfo != 'ok') {
                    $('#logoutlink').hide();
                    $('#loginlink').show();
                    window._isInitedUSSD = false;
                } else {
                    $('#logoutlink').show();
                    $('#loginlink').hide();
                }

                _readTrafficSatistics(data)
                _baseGlobalParam.BaseInfo = data;
                if (data.ppp_status == 'ppp_connected') {
                    $('#spanConnNetTitle').attr('data-trans', 'JAZZNetwork');
                    $('#spanNetworkStatusImg').removeClass('bg-wrap-off').addClass('bg-wrap-on');
                    $('#spanNetworkStatusStr').attr('data-trans', 'connected');
                } else if (data.ppp_status == 'ppp_disconnected') {
                    _baseDisConnectedStatusInfo();
                } else {
                    $('#spanConnNetTitle').attr('data-trans', 'JAZZNetwork');
                    $('#spanNetworkStatusStr').attr('data-trans', 'disconnected');
                    $('#spanNetworkStatusStr').attr('data-trans', data.ppp_status);
                }

                $('#spanClientCount').html((parseInt(data.sta_count) || 0));
                $('#spanRecSent').html(getDisplayVolume2(data.monthly_tx_bytes) + "/" + getDisplayVolume2(data.monthly_rx_bytes));
                $('#spanDownlink').html(getDisplayVolume2(data.realtime_rx_thrpt) + $.i18n.prop('speed_sec'));
                $('#spanUplink').html(getDisplayVolume2(data.realtime_tx_thrpt) + $.i18n.prop('speed_sec'));
                $('.spanNetworkType').html(convertSignalStr(data)).show();

                var _networkType = window._service.getStatusInfo().networkType.toLowerCase();
                if (_networkType == '' || _networkType == 'limited service' || _networkType == 'limited_service' || _networkType == 'no service' || _networkType == 'no_service') {
                    data.signalbar = 0;
                    if (_baseGlobalParam.ShowNoInternet) {
                        _baseOpenNoInternet('you_not_connected_network');
                    } else {
                        $('#no-connection-popup').hide();
                        if (window.location.hash == '#home') {
                            $('#ifrContainer').html('<div style="text-align: center;margin-top: 50px;color: red;" id="tempContainer"><span data-trans="you_not_connected_network"></span></div>');
                        }
                    }
                } else {
                    $('#no-connection-popup').hide();
                }
                $('.signal').removeClass().addClass('signal signal' + data.signalbar);

                var state = data.modem_main_state.toLowerCase();
                if (state == "modem_sim_undetected" || state == "modem_undetected" || state == "modem_sim_destroy") {
                    window._noSIM = true;
                    if (_baseGlobalParam.ShowNoInternet) {
                        _baseOpenNoInternet('no_sim_card_message');
                    } else {
                        $('#no-connection-popup').hide();
                        if (window.location.hash == '#home') {
                            $('#ifrContainer').html('<div style="text-align: center;margin-top: 50px;color: red;" id="tempContainer"><span data-trans="no_sim_card_message"></span></div>');
                        }
                    }
                } else {
                    $('#no-connection-popup').hide();
                }

                // 短信闪烁
                var unReadNum = (parseInt(data.sms_unread_num) || 0);
                if (unReadNum == 0 && _baseGlobalParam.UnReadMsgInterval != null) {
                    clearInterval(_baseGlobalParam.UnReadMsgInterval);
                    _baseGlobalParam.UnReadMsgInterval = null;
                    $('.message-header').show();
                }
                if (unReadNum > 0) {
                    _baseGetSMSMessages();
                }

                $('.main-header,#tempContainer').translate();
            }).error(function() {});
        }

        function _baseGetSMSMessages() {
            var param = {
                cmd: 'sms_data_total',
                page: 0,
                data_per_page: 100,
                mem_store: 1,
                tags: 1,
                order_by: 'order by id desc'
            }
            getSMSMessages(param, function(flag, data) {
                if (flag) {
                    $.each(data, function(index, item) {
                        var smsId = 'UnReadSMS_' + item.id;

                        if (_baseGlobalParam.ShowedSMSIds.indexOf(smsId) == -1) {
                            var list_all_message =
                                '<div class="bubbleItem" id="' + smsId + '">' +
                                '   <h3>' +
                                '       <span data-trans="contact_Message"></span>' + item.number +
                                '       <a href="javascript:void(0);" data-targetid="' + smsId + '" class="bubbleCloseBtn" onclick="_baseCloseBubbleSMS(\'' + smsId + '\');"></a>' +
                                '   </h3>' +
                                '   <div class="bubbleContainer">' +
                                '       <div class="bubbleContent">' + decodeMessage(escapeMessage(item.content)) + '</div>' +
                                '       <div class="bubbleDatetime">' + transTime('20' + item.date) + '</div>' +
                                '   </div>' +
                                '</div>';
                            setTimeout(function() {
                                $('#' + smsId).remove();
                            }, 1000 * 30);
                            $('#buttom-bubble').append(list_all_message);
                            _baseGlobalParam.ShowedSMSIds.push(smsId);
                        }
                    });

                    $('#buttom-bubble').translate();
                }
            })
        }

        function _baseCloseBubbleSMS(id) {
            $('#' + id).remove();
        }

        function _baseLogout() {
            showConfirm('', 'confirm_logout', function() {
                $.post('/goform/goform_set_cmd_process', {
                    goformId: 'LOGOUT'
                }, function() {
                    // location.href = "login.html";
                    window._isInitedUSSD = false;
                    window.location.hash = '#home'
                });
            });
        }

        function hidePopupSettingWindow() {
            $.modal.close();
        }

        function _readTrafficSatistics(data) {
            ts.monthly_tx_bytes = parseInt(data.monthly_tx_bytes);
            ts.monthly_rx_bytes = parseInt(data.monthly_rx_bytes);
            ts.monthly_time = data.monthly_time;
            ts.realtime_tx_bytes = parseInt(data.realtime_tx_bytes);
            ts.realtime_rx_bytes = parseInt(data.realtime_rx_bytes);
            ts.realtime_time = data.realtime_time;
            ts.realtime_tx_thrpt = parseInt(data.realtime_tx_thrpt);
            ts.realtime_rx_thrpt = parseInt(data.realtime_rx_thrpt);
            ts.max_tx_thrpt = parseInt(data.max_tx_thrpt) || 10533;
            ts.max_rx_thrpt = parseInt(data.max_rx_thrpt) || 23858;
        }

        function _baseOpenNoInternet(msg) {
            if (msg) msg = $.i18n.prop('msg')
                // 显示No internet connection也要验证是否有链接到wifi上
            var hasConnectWifi = false;
            var apList = window._service.getHotspotList().hotspotList;
            if (apList && apList.length > 0) {
                var connectDevice = apList.find(function(x) {
                    return x.connectStatus == "1";
                });
                if (connectDevice != null) {
                    hasConnectWifi = true;
                }
            }

            if (!hasConnectWifi) {
                $('#no-connection-popup').show();
                $('#noInternetMsg').html(msg);
            }
        }

        function _baseCloseNoInternet() {
            $('.no-connection-popup').hide();
            _baseGlobalParam.ShowNoInternet = false;
        }

        function _baseDisConnectedStatusInfo() {
            var wifiSSID = _baseGlobalParam.BaseInfo.EX_SSID1;
            var wifiStatus = _baseGlobalParam.BaseInfo.sta_ip_status;
            if (wifiSSID && wifiStatus == "connect") {
                window._service.getHotspotList({}, function(data) {
                    var extSSID = "";
                    for (var i = 0, len = data.hotspotList.length; i < len; i++) {
                        if (data.hotspotList[i].connectStatus == "1") {
                            extSSID = data.hotspotList[i].ssid;
                            break;
                        }
                    }
                    if (extSSID) {
                        $('#spanConnNetTitle').attr('data-trans', 'SSID: ' + extSSID);
                        $('#spanNetworkStatusImg').removeClass('bg-wrap-off').addClass('bg-wrap-on');
                        $('#spanNetworkStatusStr').attr('data-trans', 'connected');
                    } else {
                        $('#spanConnNetTitle').attr('data-trans', 'JAZZNetwork');
                        $('#spanNetworkStatusImg').removeClass('bg-wrap-on').addClass('bg-wrap-off');
                        $('#spanNetworkStatusStr').attr('data-trans', 'disconnected');
                    }
                });
            } else {
                $('#spanConnNetTitle').attr('data-trans', 'JAZZNetwork');
                $('#spanNetworkStatusImg').removeClass('bg-wrap-on').addClass('bg-wrap-off');
                $('#spanNetworkStatusStr').attr('data-trans', 'disconnected');
            }
        }

        var need_refresh = 0,
            modem_removed = false;

        function refreshDeviceStatus() {
            $.ajax({
                url: '/goform/goform_get_cmd_process',
                type: "Get",
                timeout: 8000,
                cache: false,
                data: {
                    isTest: 'false',
                    cmd: encodeURI("loginfo"),
                    multi_data: 1
                },
                success: function(data, status) {
                    need_refresh = 0;
                    if (modem_removed) {
                        hideConfirm();
                        modem_removed = false;
                    }
                },
                error: function(x, t, m) {
                    if (t === "timeout" || t === "error") {
                        if (need_refresh < 5) need_refresh++;
                        if (need_refresh == 4) to_404();
                    }
                }
            })
        }

        function to_404() {
            var content = $.i18n.prop('modem_removed');
            modem_removed = true;
            showInfo2(content);
        }

        function gotoSmsList() {
            $('#sms_page_tab').val(0)
            if ('#sms' == window.location.hash) {
                goRouter('smslist')
            } else {
                goRouter('sms')
            }
        }
    </script>
</head>

<body lang="en" style="display: none;">
    <div id="msgOverlay">
        <div><span id="msgDiv"></span></div>
    </div>
    <div id="mainBody-fluid">
        <div id="topStatus" class="row-fluid">
            <div id="lang">
                <div id="langLogoBar" class="row-fluid langborder langborderBg">
                    <div class="span3">
                        <div class="paddingleft10 logo"></div>
                    </div>
                    <div class="span8">
                        <div id="themeContainer" class="side-right" style="margin-top:0px;">
                            <select id="selLanguage" class="marginright10" style="display: inline-block;" onchange="window.LTELanguageChange($('#selLanguage').val());">
                                <!-- <option value="ru">Русский</option> -->
                                <option value="en">English</option>
                                <!-- <option value="zh-cn">中文</option> -->
                            </select>
                            <span id="help"><a href="help.html" data-trans="Help" target="_blank"></a></span>
                            <span id="logout">
                                <a id="loginlink" class="marginright10" data-trans="login" href="javascript:void(0)" onclick="_needLogin(null,true);"></a>
                                <a id="logoutlink" class="logout marginright10" data-trans="logout" href="javascript:void(0)" onclick="_baseLogout();"></a>
                            </span>
                        </div>
                        <div id="statusBar" class="side-right margintop8" style="margin-top: -2px; color: rgb(157, 11, 14);">
                            <span class="statusItem" i18n="true" id="statusItemSimStatus" tiptitle="sim_status_modem_init_complete">
                                <img id="statusItemSimStatusImg" data-bind="attr: {src: simStatus}" class="paddingbottom6" />
                            </span>
                            <span class="statusItem spanNetworkType" style="float:none;display: none;" data-trans="networkType"></span>
                            <span class="statusItem spanNetworkOperator" i18n="true" style="float:none;display: none;" data-trans="networkOperator" tiptitle="network_provider"></span>
                            <span class="statusItem" i18n="true" id="signal_strength" tiptitle="signal_strength"><i class="signal" data-bind="attr:{&#39;class&#39;: signalCssClass}">&nbsp;</i></span>
                            <span class="statusItem" i18n="true" id="connection_status" tiptitle="connection_status">
                                <i class="" id="iConnectionStatusImg" data-bind="attr:{&#39;class&#39;: connectionCssClass}">&nbsp;</i>
                            </span>
                            <span class="statusItem" i18n="true" id="wifi_status" data-bind="visible: hasWifi" tiptitle="wifi_status_on" style="display: none;">
                                <img class="paddingbottom6" id="wifi_status_img" data-bind="attr: {src: wifiStatusImg}" />
                            </span>
                            <span class="statusItem" i18n="true" data-bind="visible: hasBattery" tiptitle="battery_level">
                                <span id="batteryLevel" style="vertical-align:middle;display: none;"></span>
                            <img class="paddingbottom6" id="batteryCharging" data-bind="attr: {src: batteryPers}" />
                            </span>
                        </div>
                    </div>
                    <div class="span1">
                        <div class="super_4g"></div>
                    </div>
                </div>
            </div>
        </div>

        <div id="nav" data-bind="visible:showMenu()||true" class="row-fluid">
            <ul id="list-nav" data-bind="foreach: mainMenu" class="span12">
                <li data-bind="attr: {mid: hash.substring(1)}" mid="home" class="active" style="width: 11.1111%;">
                    <a data-bind="attr: {href: hash, trans: hash.substring(1)}" href="index.html#home" data-trans="home">Home</a>
                </li>

                <li data-bind="attr: {mid: hash.substring(1)}" mid="wifi_users" style="width: 11.1111%;">
                    <a data-bind="attr: {href: hash, trans: hash.substring(1)}" href="index.html#wifiUsers" data-trans="wifi_users">WIFI Users</a>
                </li>

                <li data-bind="attr: {mid: hash.substring(1)}" mid="sms_router" style="width: 11.1111%;">
                    <a data-bind="attr: {href: hash, trans: hash.substring(1)}" href="index.html#sms_router" data-trans="sms">SMS</a>
                </li>

                <li data-bind="attr: {mid: hash.substring(1)}" mid="ussd" style="width: 11.1111%;">
                    <a data-bind="attr: {href: hash, trans: hash.substring(1)}" href="index.html#ussd" data-trans="ussd">USSD</a>
                </li>

                <li data-bind="attr: {mid: hash.substring(1)}" mid="ota_update" style="width: 11.1111%;">
                    <a data-bind="attr: {href: hash, trans: hash.substring(1)}" href="index.html#ota_update" data-trans="ota_update">Update</a>
                </li>

                <li data-bind="attr: {mid: hash.substring(1)}" mid="settings_switched_dialup" style="width: 11.1111%;">
                    <a data-bind="attr: {href: hash, trans: hash.substring(1)}" href="index.html#settings_switched_dialup" data-trans="setting">Settings</a>
                </li>

                <li data-bind="attr: {mid: hash.substring(1)}" mid="mbb_app" style="width: 11.1111%;">
                    <a data-bind="attr: {href: hash, trans: hash.substring(1)}" href="index.html#mbb_app" data-trans="jazz_wifi_app">Jazz WIFIApp</a>
                </li>

                <li data-bind="attr: {mid: hash.substring(1)}" mid="jazzWebsite" style="width: 11.1111%;">
                    <a data-bind="attr: {href: hash, trans: hash.substring(1)}" href="https://jazz.com.pk/4gdevices" target="_blank" data-trans="jazz_website">Jazz Website</a>
                </li>

                <li data-bind="attr: {mid: hash.substring(1)}" mid="warrantyClaim" style="width: 11.1111%;">
                    <a data-bind="attr: {href: hash, trans: hash.substring(1)}" href="/media/CSC_List.pdf" target="_blank" data-trans="warranty_claim">Warranty Claim</a>
                </li>
            </ul>
        </div>
        <div class="row-fluid">
            <div id="mainContainer" class="row-fluid">
                <div id="ifrContainer" style="width:100%;"></div>
            </div>
        </div>

        <div id="footer" class="side-center">
            <span trans="copyright">Copyright © 1998-2021 ZTE Corporation. All rights reserved</span>&nbsp; <span trans="vertical_bar">|</span> &nbsp;<a href="https://opensource.ztedevices.com/" target="_blank" rel="noopener noreferrer" trans="open_source_licenses"
                class="extendLink">Open Source Licenses</a> &nbsp; <span id="privacy_span" trans="vertical_bar">|</span> &nbsp;<a id="privacy_a" href="https://www.ztedevices.com/en/Privacy-Policy/ZTESmartRouterPrivacyPolicy" target="_blank" rel="noopener noreferrer"
                trans="privacy_policy" class="extendLink">Privacy Policy</a>
        </div>
    </div>
    <div id="loading">
        <div class="header"><span id="loadMsg"></span></div>
        <br>

        <div style="text-align: center">
            <img id="loadingImg" src="img/loading.gif">
            <div id="loading_container"></div>
        </div>
    </div>

    <div id="progress">
        <div class="header"><span id="barMsg"></span></div>
        <br>
        <div class="progress-content">
            <div class="progress-bar-container">
                <div id="bar" class="progress-bar"></div>
                <div id="barValue" class="progress-bar-value"></div>
            </div>
            <div id="progress_container" class="progress-prompt"></div>
        </div>
    </div>
    <div id="confirm" class="simplemodal-data">
        <div class="header"><span id="confirm-title"></span></div>
        <div id="confirm-message-container">
            <div class="icon"></div>
            <div class="confirm-message">
                <div id="confirm-content"></div>
            </div>
        </div>
        <div class="buttons">
            <input type="button" class="btn-1" id="yesbtn" data-trans="yes" />
            <input type="button" class="btn-1 simplemodal-close" id="nobtn" data-trans="no" />
        </div>

        <div class="close-btn send-sms-dialog-close" id="closeBtn">
        </div>
    </div>

    <!-- confirm content for sbm -->
    <div id="confirm_sbm">
        <div class="header"><span id="popTitle_sbm"></span></div>
        <div id="confirm-message-container_sbm">
            <div class="icon"><img id="confirmImg_sbm"></div>
            <div class="confirm-message">
                <div class="message"></div>
                <div class="promptDiv hide">
                    <input name="promptInput" id="promptInput_sbm" type="text" maxlength="25" class="width190"><br>
                    <label class="promptErrorLabel colorRed"></label>
                </div>
            </div>
        </div>
        <div class="buttons">
            <input type="button" class="btn-1 " id="okbtn_sbm" trans="ok" value="OK">
            <input type="button" class="btn-1 " id="yesbtn_sbm" trans="yes" value="Yes">
            <input type="button" class="btn-1 " id="nobtn_sbm" trans="no" value="No">
        </div>
    </div>

    <div id="popupModifyFotaSetWindow">
        <div class="header">
            <p class="tag-popup-close">
                <a href="javascript:hidePopupModifyPwWindow();"></a>
            </p>
        </div>
        <div id="fotaSetContainer" style="background: #fff;" class="modal-body"></div>
    </div>
    <div id="buttom-bubble">
    </div>

    <div id="popupSettingWindow" class="simplemodal-data" style="display: none;border: none;width:320px;">
        <div>
            <p class="tag-popup-close">
                <a href="javascript:hidePopupSettingWindow();"></a>
            </p>
        </div>
        <div id="htmlContainer" class="modal-body">
            <div id="confirmForCus" class="form-body" style="margin-top:0px">
                <form id="loginForm2" novalidate="novalidate">
                    <div class="form-title" id="popTitleForCus" style="background: #9d0b0e;height:22px">
                        <span trans="login" style="color:#FFFFFF">Login</span>
                    </div>
                    <div id="confirm-message-containerForCus" style="padding-top:24px;padding-left:35px;">
                        <div class="icon" style="display: none;">
                        </div>
                        <div class="confirm-message">
                            <div class="message"></div>
                            <div id="logIn">
                                <div class="promptDiv" style="margin-bottom:10px;">
                                    <div><label trans="usrnameForCus" style="font-weight: bold">User name:</label> </div>
                                    <input id="txtUserName" type="text" value="admin" class="width190 disabled" disabled="disabled"><br>
                                </div>
                                <div class="promptDiv">
                                    <div><label class="side-right" trans="pswForCus" style="font-weight: bold">Password:</label> </div>
                                    <input name="promptInput" onkeydown="if(event.keyCode==13){_login();}" autocomplete="off" id="txtPwd" type="password" class="width190 required" data-bind="value:password, valueUpdate: 'keypress'" maxlength="32"><br>
                                    <label id="txtPwdError" for="txtPwd" generated="true" class="error" style="display: none;">Required</label>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div style="margin-top:30px;margin-bottom: 20px; margin-left: 110px;">
                        <span id="yesSpanForCus">
                         <span class="button_wrapper"> <span class="button_left">
                         <span class="button_right"> <span class="button_center">
                         <input type="button" id="yesbtnForCus" class="btn-1" trans="login" onclick="_login();" value="Login">
                         </span> </span>
                        </span>
                        </span>
                        </span>
                        <span id="noSpanForCus">
                         <span class="button_wrapper"> <span class="button_left">
                         <span class="button_right"> <span class="button_center">
                         <input type="button" id="nobtnForCus" class="btn-1" trans="cancel" onclick="hidePopupSettingWindow()" value="Cancel">
                         </span> </span>
                        </span>
                        </span>
                        </span>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <script type="text/x-jquery-tmpl" id="newMessagePopTmpl">
        <div class="bubbleItem ${report}" id="${mark}">
            <h3>
                <span trans="${titleTrans}">${title}</span> ${name}
                <a href="javascript:void(0);" data-targetid="${mark}" onclick="$('#${mark}').hide();" class="bubbleCloseBtn"></a>
            </h3>
            <div class="bubbleContainer">
                <div class="bubbleContent">${content}</div>
                <div class="bubbleDatetime">${datetime}</div>
            </div>
        </div>
    </script>
    <!-- <script src="js/jquery.validate.en.js"></script> -->
    <script src="/js/lib/jquery/jquery.validate.js"></script>
    <script src="/js/lib/jquery/additional-methods.js"></script>
    <script src="js/lib/jquery/jquery.i18n.properties-1.0.9.js"></script>
    <script src="js/config/jQuery.fileinput.js"></script>
    <script src="js/lib/underscore/underscore-min.js"></script>
    <script src="js/lib/jquery/jquery.tmpl.min.js"></script>
    <script src="js/lib/echarts.min.js"></script>
    <script src="/js/lib/jquery/chosen.jquery.js"></script>
</body>

</html>